package net.zjitc.securityloginapijwt;

import jakarta.annotation.Resource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;

@SpringBootApplication
@MapperScan("net.zjitc.securityloginapijwt.mapper")
public class SecurityLoginApiJwtApplication implements CommandLineRunner {
    @Resource
    private RedisTemplate<String,Object> redisTemplate;
    public static void main(String[] args) {
        SpringApplication.run(SecurityLoginApiJwtApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        redisTemplate.setKeySerializer(RedisSerializer.string());
        redisTemplate.setHashKeySerializer(RedisSerializer.string());
        redisTemplate.setHashValueSerializer(RedisSerializer.string());
    }
}
